act_site = [1 2 4 7 8];
pas_site = [3 5 6 9];

for site = 1:9
    for layer = 1:4
        act_cell_cnt = 0;
        for cell_id = 1:size(proj_meta(site).rd(layer,1).act,1)
            cur_act = horzcat(proj_meta(site).rd(layer,1:4).act);
            cur_cact = cur_act(cell_id,:);
            neg = cur_cact(cur_cact < 1);
            std = sqrt(sum((neg-1).^2)/length(neg));
            
            crit{site,layer,cell_id} = 3.72*std+1;
            
            cur_cact(cur_cact <= 3.72*std+1) = 0;
            cur_cact(cur_cact > 3.72*std+1) = 1;
            
            for frame = 1:length(cur_cact)-14
                if sum(cur_cact(frame:frame+14)) == 15
                    act_cell_cnt = act_cell_cnt+1;
                    act_cell{site,layer}(act_cell_cnt) = cell_id;
                    break
                end
            end
        end
    end
end